home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mntdoc01 / dekcarc / cat2 / pwait.nr
Text File  |  1993-03-03  |  3KB  |  133 lines

  1.  
  2.  
  3.  
  4. Pwait3(2)                  Oct. 1, 1991                 Pwait3(2)
  5.  
  6.  
  7. N✓NA✓AM✓ME✓E
  8.        Pwait, Pwait3 - get exit status of children
  9.  
  10. S✓SY✓YN✓NO✓OP✓PS✓SI✓IS✓S
  11.        LONG Pwait();
  12.        LONG Pwait3( WORD flag, LONG *rusage );
  13.  
  14. D✓DE✓ES✓SC✓CR✓RI✓IP✓PT✓TI✓IO✓ON✓N
  15.        _✓P_✓w_✓a_✓i_✓t_✓3 attempts to determine the exit code for any stopped
  16.        children or children that have terminated.  If  bit  1  of
  17.        _✓f_✓l_✓a_✓g  is  set,  then  children that are stopped due to job
  18.        control are reported; otherwise only  children  that  have
  19.        actually  terminated  are reported. A stopped process will
  20.        be reported at most once  (unless  it  is  re-started  and
  21.        stopped  again);  similarly  a  terminated process will be
  22.        reported only once.
  23.  
  24.        If the process does have children, but none are  currently
  25.        stopped  or  terminated  and  not yet waited for, then the
  26.        behavior of _✓P_✓w_✓a_✓i_✓t_✓3 is controlled by bit 0 of _✓f_✓l_✓a_✓g.  If  it
  27.        is  clear,  the  function  will  wait  until some child is
  28.        stopped or terminates; if it is  set,  the  function  will
  29.        return immediately.
  30.  
  31.        The  _✓r_✓u_✓s_✓a_✓g_✓e  parameter,  if  non-zero, should point to two
  32.        long words, into which information about the  child's  CPU
  33.        time usage is placed, as follows:
  34.        rusage[0]: milliseconds spent by child in user space
  35.        rusage[1]: milliseconds spent by child in kernel space
  36.  
  37.        The  _✓P_✓w_✓a_✓i_✓t()  system call is equivalent to _✓P_✓w_✓a_✓i_✓t_✓3(2, (LONG
  38.        *)0), and is provided both for convenience and  for  back-
  39.        ward compatibility.
  40.  
  41. R✓RE✓ET✓TU✓UR✓RN✓NS✓S
  42.        If  a  child process is found, its process id is placed in
  43.        the upper 16 bits of the 32 bit value  returned,  and  its
  44.        exit status (as passed to _✓P_✓t_✓e_✓r_✓m or _✓P_✓t_✓e_✓r_✓m_✓r_✓e_✓s, as determined
  45.        implicitly by _✓P_✓t_✓e_✓r_✓m_✓0, or as determined by the type of sig-
  46.        nal  that  stopped or killed the process) is placed in the
  47.        lower 16 bits. If the process was stopped or terminated by
  48.        signal  _✓n,  then  its  exit  status will be ( _✓n<< 8 ) | _✓x.
  49.        where _✓x is 127 if the process was stopped  and  0  if  the
  50.        process was terminated.
  51.  
  52.        0 if bit 0 of _✓f_✓l_✓a_✓g is set and the _✓P_✓w_✓a_✓i_✓t_✓3 system call would
  53.        have otherwise blocked waiting for  a  child  to  exit  or
  54.        stop.
  55.  
  56.        EFILNF if no unwaited for children exist
  57.  
  58. S✓SE✓EE✓E A✓AL✓LS✓SO✓O
  59.        _✓P_✓e_✓x_✓e_✓c(2), _✓P_✓t_✓e_✓r_✓m(2), _✓P_✓t_✓e_✓r_✓m_✓0(2), _✓P_✓t_✓e_✓r_✓m_✓r_✓e_✓s(2)
  60.  
  61.  
  62.  
  63.  
  64. Version 0.9          MiNT Programmer's Manual                   1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. Pwait3(2)                  Oct. 1, 1991                 Pwait3(2)
  71.  
  72.  
  73. B✓BU✓UG✓GS✓S
  74.        It is not possible to wait for a specific child process.
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130. Version 0.9          MiNT Programmer's Manual                   2
  131.  
  132.  
  133.